﻿@page "/login"
@namespace MXERP.Client.Pages.SignEntry
@attribute [AllowAnonymous]

<div class="d-flex justify-center">
    <img src="full-stack-hero-logo.png" Style="height:120px" />
</div>
<div class="fsh-center-text">
    <MudText Typo="Typo.h4" GutterBottom="true">登录</MudText>
    @* <MudText>Enter your credentials to get started.</MudText> *@
</div>
<br />
<EditForm Model="_signInRequest" OnValidSubmit="SubmitAsync">
    <MudGrid>
        <DataAnnotationsValidator />
        <CustomValidation @ref="_customValidation" />
        <MudItem xs="12">
            <MudTextField T="string" Label="用户名" Variant="Variant.Outlined" @bind-Value="_signInRequest.UserName"
                          For="@(() => _signInRequest.UserName)" />
        </MudItem>
        <MudItem xs="12">
            <MudTextField Label="密码" Variant="Variant.Outlined" @bind-Value="_signInRequest.Password"
                          For="@(() => _signInRequest.Password)" InputType="@_passwordInput" Adornment="Adornment.End"
                AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="TogglePasswordVisibility" />
        </MudItem>
       @*  <MudItem xs="12">
            <MudTextField T="string" Label="@L["Tenant"]" Variant="Variant.Outlined" @bind-Value="TenantId"
                For="@(() => TenantId)" Required />
        </MudItem> *@
        
        @* <MudItem xs="12" md="6">
            <MudButton StartIcon="@Icons.Material.Filled.AppRegistration" Href="/users/self-register">Register?</MudButton>
        </MudItem> *@
         @* <MudItem xs="12" md="6">
            <MudButton StartIcon="@Icons.Material.Filled.LockReset" Href="/account/forgot-password">Forgot password?</MudButton>
        </MudItem> *@
        <MudItem xs="12" Class="d-flex justify-center">
            <MudButton ButtonType="ButtonType.Submit" Disabled="BusySubmitting" Variant="Variant.Filled"
                       Color="Color.Primary" Size="Size.Large" StartIcon="@Icons.Material.Filled.Login" Style="width: 100%;">登录</MudButton>
        </MudItem>
        @* <MudItem xs="12">
            <MudButton StartIcon="@Icons.Material.Filled.Password" OnClick="FillAdministratorCredentials">Fill Administrator Credentials</MudButton>
        </MudItem> *@
    </MudGrid>
</EditForm>